home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 8 / FM Towns Free Software Collection 8.iso / t_os / artemis / artsrc2 / gboxfill.asm < prev    next >
Assembly Source File  |  1994-06-01  |  2KB  |  123 lines

  1. ;    私製ライブラリ・グラフィック篇
  2. ;    (c) MATSUUCHI Ryosuke in Dec,1992
  3. ;
  4. ;    gboxfill.asm
  5. ;
  6. ;    1992. 7.16(Thu)
  7. ;    1992.12.28(Sun)
  8.  
  9.  
  10.         public    gboxfill,grboxfill,_gboxfill,_grboxfill
  11.         extrn    _gwrtreg:near, _ghline:near
  12.         
  13.         include    grplib.inc
  14.         
  15.         assume    cs:cseg, ds:dseg
  16.  
  17.  
  18.  
  19. dseg segment dword 'DATA'
  20. dseg ends
  21.  
  22.  
  23.  
  24. cseg segment dword 'CODE'
  25.  
  26. ;---------------------------------------------------------------
  27. ;    _gboxfill : 
  28. ;        in  eax:x1
  29. ;            ebx:y1
  30. ;            ecx:x2
  31. ;            edx:y2
  32. ;            esi:col
  33. ;            edi:logop
  34. ;
  35. ;    void gboxfill(int x1, int y1, int x2, int y2, int col, int logop);
  36. ;    void grboxfill(int x1, int y1, int xlen, int ylen, int col, int logop);
  37. ;---------------------------------------------------------------
  38.  
  39.  
  40. gboxfill    proc
  41.         push    ebx
  42.         push    esi
  43.         push    edi
  44.         pushfd
  45.         mov    eax,[esp+16+4]
  46.         mov    ebx,[esp+16+8]
  47.         mov    ecx,[esp+16+12]
  48.         mov    edx,[esp+16+16]
  49.         mov    esi,[esp+16+20]
  50.         mov    edi,[esp+16+24]
  51.         call    _gboxfill
  52.         popfd
  53.         pop    edi
  54.         pop    esi
  55.         pop    ebx
  56.         ret
  57. gboxfill    endp
  58.  
  59.  
  60.  
  61. grboxfill    proc
  62.         push    ebx
  63.         push    esi
  64.         push    edi
  65.         pushfd
  66.         mov    eax,[esp+16+4]
  67.         mov    ebx,[esp+16+8]
  68.         mov    ecx,[esp+16+12]
  69.         mov    edx,[esp+16+16]
  70.         mov    esi,[esp+16+20]
  71.         mov    edi,[esp+16+24]
  72.         call    _grboxfill
  73.         popfd
  74.         pop    edi
  75.         pop    esi
  76.         pop    ebx
  77.         ret
  78. grboxfill    endp
  79.  
  80.  
  81.  
  82. _grboxfill    proc
  83.         or    ecx,ecx
  84.         jz    #end
  85.         or    edx,edx
  86.         jz    #end
  87.         push    ecx
  88.         push    edx
  89.         lea    ecx,[eax+ecx-1]
  90.         lea    edx,[ebx+edx-1]
  91.         call    _gboxfill
  92.         pop    edx
  93.         pop    ecx
  94. #end:        ret
  95. _grboxfill    endp
  96.  
  97.  
  98.  
  99. _gboxfill    proc
  100.         pushad
  101.         xchg    ebx,ecx        ;ebx ← x2
  102.         xchg    ecx,edx        ;ecx ← y2
  103.         xchg    edx,esi        ;edx ← col
  104.         xchg    esi,edi        ;esi ← logop, edi ← y1
  105.         cmp    ecx,edi        ;ecx←min(y1,y2), edi←max(y1,y2)
  106.         jl    #0
  107.             xchg    ecx,edi
  108.         #0:
  109.         #loop:
  110.             call    _ghline
  111.             inc    ecx
  112.             cmp    ecx,edi
  113.         jle    #loop
  114.         popad
  115.         ret
  116. _gboxfill    endp
  117.  
  118.  
  119.  
  120. cseg ends
  121.  
  122. end
  123.